<?php

/* 
 * 配置类
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
class configModel extends db_help
{
    public $keyFields = 'id';//设置主键
    public function __construct() {
        parent::__construct();
        $this->table_name = $this->table('config');
    }
    public static function load(){
        return new self();
    }

    /**
     * 获取配置列表 code,value
     * @return array 结果
     */
    public function get_list() {
        $data = $this->getAll('code,value');
        $list = array();
        if($data) {
            foreach ($data as $row) {
                $list[$row['code']] = $row['value'];
            }
        }
        return $list;
    }
}
